package com.dqhl.community.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.dqhl.community.R;
import com.dqhl.community.base.BaseMyAdapter;
import com.dqhl.community.model.FamilyProjectBean;

import java.util.List;

/**
 * Created by LIENLIN on 2016/8/30.
 */
public class FamilyProjectAdapter extends BaseMyAdapter {

    private List<FamilyProjectBean> list;
    public FamilyProjectAdapter(Context context,List<FamilyProjectBean> list) {
        super(context);
        this.list=list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int i) {
        return list.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {

        View v = inflater.inflate(R.layout.gv_familyproject_item, viewGroup, false);
        TextView mTvTitle = (TextView) v.findViewById(R.id.tv_family_item_1);
        TextView mTvTime = (TextView) v.findViewById(R.id.tv_24time);
        TextView mTvMoney = (TextView) v.findViewById(R.id.tv_family_money);
        FamilyProjectBean familyProjectBean = list.get(i);
        mTvTitle.setText(familyProjectBean.getType());
        mTvTime.setText(familyProjectBean.getPrice());
        mTvMoney.setText("¥"+familyProjectBean.getMoney());
        return v;
    }

}
